<?php echo script::add('jquery'); ?>
<?php echo $editor_js; ?>
<script type="text/javascript">$(document).ready(function(){$('#submit_button').click(function(){
var post_id=$('#post_id').val();var title=$('#title_box').val();var class01=$('#class_box').val();var content=KE.html('content_box');var tag=$('#tag_box').val();var keyword=$('#meta_keyword_box').val();var description=$('#meta_description').val();var type=$('input[name=type_box]:checked').val();if(title==''){alert('标题不能为空');$('input[name=title_box]').focus();return false;}if(class01==0){alert('请选择文章分类');return false;}if(content==''){alert('文章内容不能为空');return false;}
$.post('<?php echo $this->get_action_url('ajax_edit_article'); ?>', {post_id:post_id,title_box:title,content_box:content,class_box:class01,type_box:type,tag_box:tag,meta_keyword_box:keyword,meta_description:description}, function(data){switch(data){case '101':alert('文章添加成功!');location.href='<?php echo $this->get_action_url('index'); ?>/?page=<?php echo $page; ?>';break; case '100':alert('文章添加失败!');break;default:alert(data);}});
});});</script>
<table width="800" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="30" align="left">>><?php echo $site_name; ?></td>
      </tr>
      <tr>
        <td align="left" valign="top">
		<table width="800" border="0" cellspacing="5" cellpadding="0" style="margin:0px; border:0px; border:none;">
          <tr>
            <td width="100" height="30" align="right">标题：</td>
            <td width="475"><input type="text" name="title_box" id="title_box" value="<?php echo $post_data['post_title']; ?>"/><input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>" /></td>
            <td width="60" align="center">分类:</td>
            <td width="140"><?php echo html::select($class_array, array('name'=>'class_box', 'id'=>'class_box'), $post_data['post_class']); ?></td>
          </tr>
          <tr>
            <td width="100" height="420" align="right" valign="top">内容：</td>
            <td colspan="3" align="left" valign="top"><textarea name="content_box" style="width:640px; height:410px;" id="content_box"><?php echo $post_data['post_content']; ?></textarea></td>
          </tr>
          <tr>
            <td width="100" height="30" align="right">标签：</td>
            <td align="left"><input type="text" name="tag_box" id="tag_box" value="<?php echo $tag_str; ?>"/></td>
            <td align="center">类型：</td>
            <td><?php echo html::radio(array('0'=>'公开', '1'=>'私有'), array('name'=>'type_box'), $post_data['post_status']); ?></td>
          </tr>
          <tr>
            <td height="30" align="right">keywords ： </td>
            <td height="30" align="left"><input type="text" name="meta_keyword_box" id="meta_keyword_box" value="<?php echo $meta_data['meta_keyword']; ?>"/></td>
            <td height="30" align="center">时间：</td>
            <td height="30" align="left" style="font-size:12px;"><?php echo $post_data['date_added']; ?></td>
          </tr>
          <tr>
            <td height="70" align="right">description： </td>
            <td height="30" colspan="3" align="left" valign="top"><textarea name="meta_description" id="meta_description"><?php echo $meta_data['meta_description']; ?></textarea></td>
          </tr>
          <tr>
            <td height="30" colspan="4" align="center"><input type="button" name="submit_button" value="提交" id="submit_button"/></td>
          </tr>
</table>
		</td>
      </tr>
</table>
